<template>
  <main>
    <el-table :data="tableData" style="width: 100%">
      <el-table-column prop="id" label="id" width="180" />
      <el-table-column prop="userip" label="ip" width="180" />
      <el-table-column prop="text" label="text" />
    </el-table>
  </main>
</template>

<script lang="ts">
import { defineComponent, reactive, toRefs } from "vue";
import { selectMessage } from "@/api/serverRequest";
export default defineComponent({
  name: "",
  props: {},
  components: {},
  setup() {
    let tableData = reactive([
      {
        id: "",
        userip: "",
        text: "",
      },
    ]);

    selectMessage().then((response) => {
      tableData.push(...response.data);
      tableData.shift();
    });

    return {
      tableData,
    };
  },
});
</script>

<style scoped lang="scss">
main {
  width: 80vw;
  margin: 0 auto;
}
</style>
